package pt.nmfa.peste.entity;

// Generated Mar 5, 2011 1:52:20 PM by Hibernate Tools 3.3.0.GA

import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import org.hibernate.validator.Length;

/**
 * Category generated by hbm2java
 */
@Entity
@Table(name = "Category", catalog = "HomeDB")
public class Category implements java.io.Serializable {

	private Integer categoryId;
	private String category;
	private Set<ChannelsCategory> channelsCategories = new HashSet<ChannelsCategory>(
			0);

	public Category() {
	}

	public Category(String category, Set<ChannelsCategory> channelsCategories) {
		this.category = category;
		this.channelsCategories = channelsCategories;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "categoryId", unique = true, nullable = false)
	public Integer getCategoryId() {
		return this.categoryId;
	}

	public void setCategoryId(Integer categoryId) {
		this.categoryId = categoryId;
	}

	@Column(name = "category", length = 100)
	@Length(max = 100)
	public String getCategory() {
		return this.category;
	}

	public void setCategory(String category) {
		this.category = category;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "category")
	public Set<ChannelsCategory> getChannelsCategories() {
		return this.channelsCategories;
	}

	public void setChannelsCategories(Set<ChannelsCategory> channelsCategories) {
		this.channelsCategories = channelsCategories;
	}

}
